import PanelObjectConst from "./common/PanelObjectConst";
import FeatureLoader from "../framework/FeatureLoader";

export default {
  name: 'DynamicObjectConst',

  extendCfgList(schemaId, pCfgList, metaStoreObj) {
    pCfgList.forEach(item => {
      if (item.formType === 'selectMulti') {
        if (schemaId === 'frontcomdirective' && item.modelKey === 'initialDim') {
          item.selectList = PanelObjectConst['initialDimSelect'];
        } else if (schemaId === 'frontcomdirective' && item.modelKey === 'initialMetric') {
          item.selectList = PanelObjectConst['initialMetricSelect'];
        } else {
          debugger;
        }
      } else if (item.modelKey.startsWith('$_')) {
        const typeKey = schemaId;
        const containerInst = FeatureLoader().comRequireMap[typeKey];

        item.formType = 'select';
        item.selectList = containerInst.comRequireSelect;
      }
    });
  },
};